<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <!-- 解释Promise的then使用时候是串联 会导致什么 异常穿透 -->
    <!-- 串联时候如果中间出现报错那么会穿透到最后的回调中 -->
    <script>
        let p = new Promise((resolve , reject)=>{
            setTimeout(()=>{
                resolve("OK")
            },1000)
        })
        p.then(value =>{
            throw "this is Bug"
            console.log(value)
        }).then(value=>{
            console.log(value)
        }).then(value=>{
            console.log(value)
        }).then(value=>{
            console.log(value)
        }).then(value=>{
            console.log(value)
        }).then(value=>{
            console.log(value)
        }).then(value=>{
            console.log(value)
        }).then(value=>{
            console.log(value)
        }).then(value=>{
            console.log(value)
        }).then(value=>{
            console.log(value)
        }).then(value=>{
            console.log(value)
        })
    </script>
</body>
</html>